﻿package com.xkrys.event 
{
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Christopher Courtois
	 */
	public class TrackEvent extends Event 
	{
		
		public static const X_CHANGE:String = "TrackEvent.xChange";
		public static const Y_CHANGE:String = "TrackEvent.yChange";
		public static const SCALE_X_CHANGE:String = "TrackEvent.scaleXChange";
		public static const SCALE_Y_CHANGE:String = "TrackEvent.scaleYChange";
		public static const WIDTH_CHANGE:String = "TrackEvent.widthChange";
		public static const HEIGHT_CHANGE:String = "TrackEvent.heightChange";
		
		private var _newValue:Number;
		private var _oldValue:Number;
		
		
		public function TrackEvent(type:String, oldValue:Number, newValue:Number, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type, bubbles, cancelable);
			_oldValue = oldValue; 
			_newValue = newValue; 
			
		} 
		
		public function get oldValue():Number { return _oldValue; }
		public function get newValue():Number { return _newValue; }
		
		public override function clone():Event 
		{ 
			return new TrackEvent(type, oldValue, newValue, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("TrackEvent", "type", "bubbles", "cancelable", "eventPhase","oldValue","newValue"); 
		}
		
	}
	
}